<template></template>
<script setup lang="ts">
/**
 * toRaw
 */
const user = reactive({
  name: '张三',
  age: 18,
})

const userToRaw = toRaw(user)
console.log('user:', user)
console.log('userToRaw:', userToRaw)

/**
 * markRaw
 */

const car = { brand: '奔驰', price: 100 }
const carCopy = reactive(car) // 响应式对象

const car2 = markRaw({ brand: '奔驰', price: 100 })
const carCopy2 = reactive(car2) // 不行了。是原始对象。

console.log('car2:', car2)
console.log('carCopy2:', carCopy2)
</script>
<style scoped></style>
